#include "../client/rpc_client.hpp"
#include <thread>
#include <chrono>
int main()
{
    //1.实例化客户端对象
    auto client =std::make_shared<bitrpc::client::TopicClient>("127.0.0.1",7070);

    //2.创建主题
    std::string subject = "hello";
   bool ret = client->create(subject);
   if(ret == false)
   {
    ELOG("主题创建失败");
    return 1;
   }

    //3.向主题发布消息
    for(int i =0 ;i<1;i++)
    {
        client->publish(subject,"hello bit-"+std::to_string(i));
    }
    std::this_thread::sleep_for(std::chrono::seconds(100)); // 只使当前线程休眠，跨平台性强

    client->ShutDown();
    return 0 ;

}